﻿using Data.Service;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SYT.Web.Controllers
{
    public class CategoryLayerController : Controller
    {
        //
        // GET: /CategoryLayer/

        //类目选择弹层
        public ActionResult CategoryLayer()
        {
            return View();
        }

        //通过父id获取类目
        public string GetGategory()
        {
            string pId = Request["parentId"];
            return JsonConvert.SerializeObject(CategoryData.GetCategory(pId));
        }
        //关键字搜索类目
        public string SearchCtegory()
        {
            string keyword = Request["keyword"];
            return JsonConvert.SerializeObject(CategoryData.GetCategoryByKeyword(keyword));
        }
    }
}
